package tank01;

import java.awt.*;

/**
 * @Auther: xiaofei
 * @Date: 2021/7/1 - 07 - 01 - 14:15
 * @Description: tank01
 * @version: 1.0
 */
public class Explode {
    private int x,y;
    private TankFrame tf;

    //计算爆炸的宽度和高度
    public static int WIDTH = ResouceMgr.explode.getWidth();
    public static int HEIGHT = ResouceMgr.explode.getHeight();

    private int step = 0;
    private boolean living = true;

    public Explode() {
    }

    public Explode(int x, int y, TankFrame tf) {
        this.x = x;
        this.y = y;
        this.tf = tf;
    }

    public void paint(Graphics g){
        g.drawImage(ResouceMgr.explode,x,y,null);

        //15步后移除爆炸
        step++;
        if(step > 15){
            tf.explodes.remove(this);
        }
    }
}
